home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr25
/
newzips.zip
/
NEWZIPS.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-06-21
|
2KB
|
70 lines
/* */
/* trace ?r */
/******************************************************************
Change the next two lines to set default directories
*******************************************************************/
defaultdown = 'e:\download'
defaultdest = 'f:\tools'
/******************************************************************/
arg downdirect destdirect .
if downdirect = '' then downdirect = defaultdown
if destdirect = '' then destdirect = defaultdest
if downdirect = '.' then downdirect = directory()
downdrive = left(downdirect,1)
destdrive = left(destdirect,1)
if (right(downdirect,1) <> '\') then downdirect = downdirect'\'
if (right(destdirect,1) <> '\') then destdirect = destdirect'\'
Call RxFuncAdd 'SysSetObjectData', 'RexxUtil', 'SysSetObjectData'
/* pull anything already in the queue */
numb = queued()
do i = 1 to numb
pull .
end
'dir 'downdirect||'*.* | rxqueue' /* get list of files */
/* 'dir 'downdirect||'*.lzh | rxqueue' */
i=0
numb = queued()
do j = 1 to numb
parse upper pull name type .
select
when type = 'ZIP'
then do
destdrive':' /* switch to destination drive */
newdirect = destdirect||name
'md 'newdirect
'cd ' newdirect
/**************************************************************
Change the next line to use the right unzip routine
***************************************************************/
'unzip -o ' downdirect||name
if rc = 0 then
do
'erase 'downdirect||name||'.piz'
'rename 'downdirect||name||'.zip' name||'.piz'
Call SysSetObjectData newdirect, 'OPEN=DEFAULT'
end
end
when type = 'LZH'
then do
destdrive':' /* switch to destination drive */
newdirect = destdirect||name
'md 'newdirect
'cd ' newdirect
/*************************************************************
Change the next line to use the right LHZ unarchiver
*************************************************************/
'LH32 X /o' downdirect||name
if rc = 0 then
do
'erase 'downdirect||name||'.hzl'
'rename 'downdirect||name||'.lzh' name||'.hzl'
Call SysSetObjectData newdirect, 'OPEN=DEFAULT'
end
end
otherwise
end
end
Call SysSetObjectData LEFT(DOWNDIRECT,LENGTH(downdirect)-1) , 'OPEN=DEFAULT'